import http from "../request"
import { userAddress } from "../types/userAddress"
let commonUrl = '/ignore/user/address'
import { Basic } from "../types"

export function getAddressList(userId: number) {
	return http<userAddress.userAddressType[]>({
		url: commonUrl + `/user/query?userId=${userId}`,
		method: 'GET'
	})
}

/**
 * 用户添加地址
 */
export function addAddress( data: userAddress.addAddressType) {
  return http<Basic>({
    url: commonUrl + `/user/add`,
    method: 'POST',
    data: data, // 将请求体数据传递给后端
  });
}

/**
 * 用户删除地址
 */
export function delAddress( data: userAddress.addAddressType) {
  return http<Basic>({
    url: commonUrl + `/user/add`,
    method: 'POST',
    data: data, // 将请求体数据传递给后端
  });
}

/**
 * 用户修改地址
 */
export function editAddress( data: userAddress.addAddressType) {
  return http<Basic>({
    url: commonUrl + `/user/add`,
    method: 'POST',
    data: data, // 将请求体数据传递给后端
  });
}


